Hello i am looking for a strong dxl script in order to copy all module attributes from one module to another one, as fast as possible with a simple call in main script with format CopyAttrMod(Module Src, Module Target) thanks for your help Marc BIS Eclairage93 - Wed Mar 15 05:11:32 EDT 2017 |
Re: DXL: how to copy module attribute to another module You should check out the copyops.inc library inside the dxl folder (lib / dxl / utils). You will find methods for copying attributes (like copyModuleAttribute_ (...)) in there. Hope this helps, regards, Mathias |
Re: DXL: how to copy module attribute to another module Mathias Mamsch - Wed Mar 15 07:54:44 EDT 2017 You should check out the copyops.inc library inside the dxl folder (lib / dxl / utils). You will find methods for copying attributes (like copyModuleAttribute_ (...)) in there. Hope this helps, regards, Mathias Hello Mathias thanks for your feedback but the *.inc files are crypted !! how to do to read them
Marc |
Re: DXL: how to copy module attribute to another module Eclairage93 - Wed Mar 15 08:19:32 EDT 2017 Hello Mathias thanks for your feedback but the *.inc files are crypted !! how to do to read them
Marc The copyops.inc is not encrypted, as are some other few. Regards, Mathias |
Re: DXL: how to copy module attribute to another module Here's an oldie-but-goody from the days of Telelogic and the "Kitchen utensils" that might be of service. Be careful of existing enumerated types in your target modules. I try scripts like this one out in a sandbox project first, just to make sure that I'm certain it does what I want it to. Good Luck!! // Copy Attrs Plus
/*
NOTES: This script assumes that the user has complete access rights to the attribute definitions
version developed on date by notes
2.0.0 DOORS 7.1 PC 14 June 04 Ian Zimmermann (Telelogic)
2.0.1 17 June 04 Ian Zimmermann (Telelogic)
18 June 04 Jeremy Dick (Telelogic)
2.1.0 18 June 04 Ian Zimmermann (Telelogic)
2.1.1 22 July 04 Ian Zimmermann (Telelogic)
28 July 04 Merged into kitchen.
if ( !confirm "This tool copies attribute definitions from the current module to other selected modules.\n" //-
"Continue?" pragma runLim, 0
// #include <addins/kitchen/utensils/modify2.inc>
/*
This programming tool has been thoroughly checked
If you do NOT accept these conditions, do NOT use
AttrType modifyKeepValues(AttrType atTypeToEdit, string sTypeName, string arrValues[], int arrOrdinals[], int arrColours[], Skip valMapping, string& sErrMsg)
/*
valMapping is a skip list used to indicate how strings have been renamed, if any. if ( null atTypeToEdit ) return null
// build mapping of old values
numStrings = sizeof(arrValues)
// look up the old position, and map the new position onto the old. delete(mapping)
return modify(atTypeToEdit, sTypeName, arrValues, arrOrdinals, arrColours, arrMaps, sErrMsg)
// Constants
const string srcDest[] = {"Source", "Destination", "Cancel"} // Variables
Module srcMod, destMod // Functions
//=================================================================================================
//=================================================================================================
//=================================================================================================
//=================================================================================================
//================================================================================================= AttrDef__ destAd = attribute ad.name
destAttDef = find(destMod, ad.name)
if (ad.object) destAttDef = modify(destAttDef, setObject, true)
if (ad.module) destAttDef = modify(destAttDef, setModule, true)
if (ad.nohistory) destAttDef = modify(destAttDef, setHistory, false)
if (ad.nochanges) destAttDef = modify(destAttDef, setDates, false)
if (ad.nobars) destAttDef = modify(destAttDef, setBars, false)
if (ad.multi) destAttDef = modify(destAttDef, setMulti, true)
if (ad.inherit) destAttDef = modify(destAttDef, setInherit, true)
if (ad.hidden) destAttDef = modify(destAttDef, setHidden, true) if (ad.dxl) destAttDef = modify(destAttDef, setDXL, ad.dxl) if (ad.defval) destAttDef = modify(destAttDef, setDefault, ad.defval)
return true
//=================================================================================================
//=================================================================================================
//=================================================================================================
//=================================================================================================
//=================================================================================================
//=================================================================================================
//=================================================================================================
//=================================================================================================
//=================================================================================================
//=================================================================================================
//=================================================================================================
attFrameDBE = frame(copyDB, "Select attributes", modWidth + 20, listLength * 20)
attListDBE = listView(copyDB, listViewOptionMultiselect, modWidth*3/2, listLength, dummy)
modFrameDBE = frame(copyDB, "Select destination module(s)", modListWidth + 20, listLength * 20)
modListDBE = listView(copyDB, listViewOptionMultiselect, modListWidth, listLength, dummy)
scopeDBE = toggle(copyDB, "Current folder only", true)
createOptnDBE = toggle(copyDB, "Create Attributes?", true)
splitDBE = splitter(copyDB, attFrameDBE, modFrameDBE, 5)
okBtnDBE = ok(copyDB, "OK", copyAttsCB)
setExtraHeightShare(attFrameDBE, 1.0)
insertColumn(attListDBE, 0, "Attribute", attWidth, iconNone)
show(copyDB) // Initializations srcMod = current
if ( null srcMod )
modSelected = 0 // Main getDest
|
Re: DXL: how to copy module attribute to another module Chris Annal - Tue Mar 28 09:00:06 EDT 2017 Here's an oldie-but-goody from the days of Telelogic and the "Kitchen utensils" that might be of service. Be careful of existing enumerated types in your target modules. I try scripts like this one out in a sandbox project first, just to make sure that I'm certain it does what I want it to. Good Luck!! // Copy Attrs Plus
/*
NOTES: This script assumes that the user has complete access rights to the attribute definitions
version developed on date by notes
2.0.0 DOORS 7.1 PC 14 June 04 Ian Zimmermann (Telelogic)
2.0.1 17 June 04 Ian Zimmermann (Telelogic)
18 June 04 Jeremy Dick (Telelogic)
2.1.0 18 June 04 Ian Zimmermann (Telelogic)
2.1.1 22 July 04 Ian Zimmermann (Telelogic)
28 July 04 Merged into kitchen.
if ( !confirm "This tool copies attribute definitions from the current module to other selected modules.\n" //-
"Continue?" pragma runLim, 0
// #include <addins/kitchen/utensils/modify2.inc>
/*
This programming tool has been thoroughly checked
If you do NOT accept these conditions, do NOT use
AttrType modifyKeepValues(AttrType atTypeToEdit, string sTypeName, string arrValues[], int arrOrdinals[], int arrColours[], Skip valMapping, string& sErrMsg)
/*
valMapping is a skip list used to indicate how strings have been renamed, if any. if ( null atTypeToEdit ) return null
// build mapping of old values
numStrings = sizeof(arrValues)
// look up the old position, and map the new position onto the old. delete(mapping)
return modify(atTypeToEdit, sTypeName, arrValues, arrOrdinals, arrColours, arrMaps, sErrMsg)
// Constants
const string srcDest[] = {"Source", "Destination", "Cancel"} // Variables
Module srcMod, destMod // Functions
//=================================================================================================
//=================================================================================================
//=================================================================================================
//=================================================================================================
//================================================================================================= AttrDef__ destAd = attribute ad.name
destAttDef = find(destMod, ad.name)
if (ad.object) destAttDef = modify(destAttDef, setObject, true)
if (ad.module) destAttDef = modify(destAttDef, setModule, true)
if (ad.nohistory) destAttDef = modify(destAttDef, setHistory, false)
if (ad.nochanges) destAttDef = modify(destAttDef, setDates, false)
if (ad.nobars) destAttDef = modify(destAttDef, setBars, false)
if (ad.multi) destAttDef = modify(destAttDef, setMulti, true)
if (ad.inherit) destAttDef = modify(destAttDef, setInherit, true)
if (ad.hidden) destAttDef = modify(destAttDef, setHidden, true) if (ad.dxl) destAttDef = modify(destAttDef, setDXL, ad.dxl) if (ad.defval) destAttDef = modify(destAttDef, setDefault, ad.defval)
return true
//=================================================================================================
//=================================================================================================
//=================================================================================================
//=================================================================================================
//=================================================================================================
//=================================================================================================
//=================================================================================================
//=================================================================================================
//=================================================================================================
//=================================================================================================
//=================================================================================================
attFrameDBE = frame(copyDB, "Select attributes", modWidth + 20, listLength * 20)
attListDBE = listView(copyDB, listViewOptionMultiselect, modWidth*3/2, listLength, dummy)
modFrameDBE = frame(copyDB, "Select destination module(s)", modListWidth + 20, listLength * 20)
modListDBE = listView(copyDB, listViewOptionMultiselect, modListWidth, listLength, dummy)
scopeDBE = toggle(copyDB, "Current folder only", true)
createOptnDBE = toggle(copyDB, "Create Attributes?", true)
splitDBE = splitter(copyDB, attFrameDBE, modFrameDBE, 5)
okBtnDBE = ok(copyDB, "OK", copyAttsCB)
setExtraHeightShare(attFrameDBE, 1.0)
insertColumn(attListDBE, 0, "Attribute", attWidth, iconNone)
show(copyDB) // Initializations srcMod = current
if ( null srcMod )
modSelected = 0 // Main getDest
Hallo When I'm trying this script I'm getting a error to bring the colors from the source module to Target module. Could you please help me. Invalid color specification (42) |
Re: DXL: how to copy module attribute to another module Chris Annal - Tue Mar 28 09:00:06 EDT 2017 Here's an oldie-but-goody from the days of Telelogic and the "Kitchen utensils" that might be of service. Be careful of existing enumerated types in your target modules. I try scripts like this one out in a sandbox project first, just to make sure that I'm certain it does what I want it to. Good Luck!! // Copy Attrs Plus
/*
NOTES: This script assumes that the user has complete access rights to the attribute definitions
version developed on date by notes
2.0.0 DOORS 7.1 PC 14 June 04 Ian Zimmermann (Telelogic)
2.0.1 17 June 04 Ian Zimmermann (Telelogic)
18 June 04 Jeremy Dick (Telelogic)
2.1.0 18 June 04 Ian Zimmermann (Telelogic)
2.1.1 22 July 04 Ian Zimmermann (Telelogic)
28 July 04 Merged into kitchen.
if ( !confirm "This tool copies attribute definitions from the current module to other selected modules.\n" //-
"Continue?" pragma runLim, 0
// #include <addins/kitchen/utensils/modify2.inc>
/*
This programming tool has been thoroughly checked
If you do NOT accept these conditions, do NOT use
AttrType modifyKeepValues(AttrType atTypeToEdit, string sTypeName, string arrValues[], int arrOrdinals[], int arrColours[], Skip valMapping, string& sErrMsg)
/*
valMapping is a skip list used to indicate how strings have been renamed, if any. if ( null atTypeToEdit ) return null
// build mapping of old values
numStrings = sizeof(arrValues)
// look up the old position, and map the new position onto the old. delete(mapping)
return modify(atTypeToEdit, sTypeName, arrValues, arrOrdinals, arrColours, arrMaps, sErrMsg)
// Constants
const string srcDest[] = {"Source", "Destination", "Cancel"} // Variables
Module srcMod, destMod // Functions
//=================================================================================================
//=================================================================================================
//=================================================================================================
//=================================================================================================
//================================================================================================= AttrDef__ destAd = attribute ad.name
destAttDef = find(destMod, ad.name)
if (ad.object) destAttDef = modify(destAttDef, setObject, true)
if (ad.module) destAttDef = modify(destAttDef, setModule, true)
if (ad.nohistory) destAttDef = modify(destAttDef, setHistory, false)
if (ad.nochanges) destAttDef = modify(destAttDef, setDates, false)
if (ad.nobars) destAttDef = modify(destAttDef, setBars, false)
if (ad.multi) destAttDef = modify(destAttDef, setMulti, true)
if (ad.inherit) destAttDef = modify(destAttDef, setInherit, true)
if (ad.hidden) destAttDef = modify(destAttDef, setHidden, true) if (ad.dxl) destAttDef = modify(destAttDef, setDXL, ad.dxl) if (ad.defval) destAttDef = modify(destAttDef, setDefault, ad.defval)
return true
//=================================================================================================
//=================================================================================================
//=================================================================================================
//=================================================================================================
//=================================================================================================
//=================================================================================================
//=================================================================================================
//=================================================================================================
//=================================================================================================
//=================================================================================================
//=================================================================================================
attFrameDBE = frame(copyDB, "Select attributes", modWidth + 20, listLength * 20)
attListDBE = listView(copyDB, listViewOptionMultiselect, modWidth*3/2, listLength, dummy)
modFrameDBE = frame(copyDB, "Select destination module(s)", modListWidth + 20, listLength * 20)
modListDBE = listView(copyDB, listViewOptionMultiselect, modListWidth, listLength, dummy)
scopeDBE = toggle(copyDB, "Current folder only", true)
createOptnDBE = toggle(copyDB, "Create Attributes?", true)
splitDBE = splitter(copyDB, attFrameDBE, modFrameDBE, 5)
okBtnDBE = ok(copyDB, "OK", copyAttsCB)
setExtraHeightShare(attFrameDBE, 1.0)
insertColumn(attListDBE, 0, "Attribute", attWidth, iconNone)
show(copyDB) // Initializations srcMod = current
if ( null srcMod )
modSelected = 0 // Main getDest
Hallo When I'm trying this script I'm getting a error to bring the colors from the source module to Target module. Could you please help me. Invalid color specification (42) |
Re: DXL: how to copy module attribute to another module Skotagiri - Thu Oct 25 04:34:34 EDT 2018 Hallo When I'm trying this script I'm getting a error to bring the colors from the source module to Target module. Could you please help me. Invalid color specification (42) Hi Skotagiri, I'm guessing that there's an attribute that's using an enumerated type, and that enumerated type is in turn using special colors. This script doesn't handle that special case very well, but you could try looking for any attributes in your source and target modules that use enumerated types, and if those enumerated types use special colors. I'm going to try to insert an image file that depicts what I'm talking about. In this case, the Base type (Pass_Fail) uses Red color for the "Fail" enumeration and in this case you would have to make sure if you're copying attributes that use that Base type, the "colors" should match...
...and here's how that enumerated type was set up...
|